<? //PAYMENT_edit.php;
$msg="";
include("PAYMENT_session.php");
if(isset($_POST["submit"]))
{
	$pk_val = $_POST["pk_val"];
	$data_class = new PAYMENT();$data_class->setPaymentID($_POST["PaymentID"]);
	$data_class->setPaymentType($_POST["PaymentType"]);
	$data_class->setAllowed($_POST["Allowed"]);
	$edit_class = new SessionPAYMENT();
	$edit_class->update($edit_class);
	$msg = "Success Update Data";
	$current_data = $update_class->find($pk_val);
}
else
{
	$pk_val = $_GET["id"];
	$search_class = new SessionPAYMENT();
	$current_data = $search_class->find($pk_val);
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Edit Data To Table PAYMENT</title>
<script src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery_validate.js"></script>
  <script>
  $(document).ready(function(){
    $("#form").validate();
  });
  </script>
</head>

<body>
<h2><?=$msg;?></h2><form name="form1" id="form" method="post" action="<?=$_SERVER["PHP_SELF"];?>">
  <table width="657" border="1">
    <tr>
      <td colspan="3">EDIT DATA</td>
    </tr><tr>
      <td width="97">PaymentID</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="PaymentID" value="<?=$current_data->PaymentID;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">PaymentType</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="PaymentType" value="<?=$current_data->PaymentType;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">Allowed</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="Allowed" value="<?=$current_data->Allowed;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr> <tr>
      <td></td>
      <td></td>
      <td>
	   <input type="hidden" name="pk_val" value="<?=$pk_val;?>" />
	  <input type="submit" name="submit" value="Edit" /></td>
    </tr>
   
  </table>
</form>
</body>
</html>
